package com.example.cloud.model.basic;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/30.
 * 会员等级配置
 */
@Entity(name = "basic_member_level")
@Data
@EqualsAndHashCode(callSuper = false)
public class MemberLevel extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 等级名称
    @Column(name = "level_name")
    private String levelName;
    // 级别
    @Column(name = "level")
    private Integer level;
    // 折扣率
    @Column(name = "discount", columnDefinition = "decimal(15,2)")
    private Double discount;
    // 指定升级金额
    @Column(name = "up_amount")
    private BigDecimal upAmount;
    // 要求充值金额
    @Column(name = "store_amount")
    private BigDecimal storeAmount;
    // 下一等级
    @Column(name = "next_level_id")
    private Long nextLevelId;
    // 下一等级名称
    @Column(name = "next_level_name")
    private String nextLevelName;
    // 默认会员{0: 否 1：是}
    @Column(name = "is_default", columnDefinition = "INT DEFAULT 0")
    private int isDefault;
    // 账户编号
    @Column(name = "account_id")
    private Long accountId;
    // 用户编号
    @Column(name = "user_id")
    private Long userId;
    // 组织机构编号
    @Column(name = "organ_id")
    private Long organId;
    // 组织机构名称
    @Column(name = "organ_name")
    private String organName;
}
